package com.ifeng.stock;

/**
 * Stock, contains stock-code and stock-name
 * stock is sortable by code 
 * @author guest
 *
 */
public class Stock implements Comparable<Stock>{
	private int code;
	private String name;
	
	@Override
	public int compareTo(Stock arg0) {
			if(((Stock)arg0).code == this.code){
				return 0;
			}else	if(((Stock)arg0).code > this.code){
				return -1;
			}else{
				return 1;
			}
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}